<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="../css/platform.css">
  <!-- 引入样式 -->
  <link rel="icon" type="image/svg+xml" href="../fox.svg">

  <link rel="stylesheet" href="../plugins/elementui/index.css">

  <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">

  <link rel="stylesheet" href="../css/style.css">
  <title>二手交易市场</title>

</head>

<body>
  <div id="app" style="height: 100%;">
    <el-container style="height: 100%; border: 1px solid #eee">
      <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
        <el-menu :default-openeds="['1', '2','3','4']">
          <!-- 个人信息 -->
          <el-submenu index="1">
            <template slot="title"><i class="el-icon-info"></i>个人信息</template>
            <el-menu-item index="1-1"
              @click="changeShow('i1');getMe();getCategories();getAppraise();getDeals()">基本信息</el-menu-item>
            <el-menu-item index="1-2" @click="changeShow('i2');getMyGoods()">我的发布</el-menu-item>
            <el-menu-item index="1-3" @click="changeShow('i3');getMyCheckGoods()">我的审核</el-menu-item>
            <el-menu-item index="1-4" @click="changeShow('i4');getAllMyBuyOrder()">我的订单</el-menu-item>
            <el-menu-item index="1-5" @click="changeShow('i9');getAllMySellOrder()">我的卖出</el-menu-item>
          </el-submenu>
          <!-- 我的消息 -->
          <el-submenu index="5">
            <template slot="title"><i class="el-icon-message"></i> <el-badge :value="messageNum" class="item">我的消息</el-badge></template>
            <el-menu-item v-for="other in others">
                <div @click="goChat(other.userId)">
                    <img  style="width: 40px; height: 40px;border-radius: 50%;" :src="other.profile" alt=""><span >&nbsp; &nbsp; &nbsp;{{other.username}}</span> 
                </div>
            </el-menu-item>
          </el-submenu>
          <!-- 商品选购 -->
          <el-submenu index="2">
            <template slot="title"><i class="el-icon-menu"></i>商品页面</template>
            <el-menu-item index="2-1" @click="changeShow('i5');getAllGoods(1)">商品选购</el-menu-item>
          </el-submenu>

          <!-- 管理页面 -->
          <el-submenu index="3">
            <template slot="title"><i class="el-icon-edit"></i>管理页面</template>
            <el-menu-item index="3-0" @click="changeShow('i6');getCheckGoods()">商品审核</el-menu-item>
            <el-menu-item index="3-1" @click="changeShow('i7');getAllUser()">用户管理</el-menu-item>
            <el-menu-item index="3-2" @click="changeShow('i8');getAllGoods(2)">商品管理</el-menu-item>
            <el-menu-item index="3-3" @click="changeShow('i10');getAllOrders()">订单管理</el-menu-item>
            <el-menu-item index="3-4" @click="openForm_log">日志获取</el-menu-item>


          </el-submenu>

          <!-- 设置 -->
          <el-submenu index="4">
            <template slot="title"><i class="el-icon-setting"></i>设置</template>
            <el-menu-item index="4-1" @click="openForm_password">修改密码</el-menu-item>
            <el-menu-item index="4-1" @click="loginout">退出登陆</el-menu-item>

          </el-submenu>
        </el-menu>
      </el-aside>

      <el-container>
        <el-header style="text-align: left; font-size: 20px">
          <i class="el-icon-success" style="margin-right: 15px"></i>
          <span style="font-weight: bold;">欢迎使用二手交易平台</span>
        </el-header>
        <!-- 个人信息-基本信息 -->
        <el-main v-show="show_content.i1">
          <el-row :gutter="20">
            <el-col :span="6">
              <div>
                <img :src="user.profile" style="
                                    border-radius: 50%;
                                    height: 150px;
                                    width: 150px;
                                " />
              </div>
            </el-col>

            <el-col :span="9">
              <p>昵称:{{user.username}}</p>
            </el-col>
            <el-col :span="9">
              <p>联系方式:{{user.phoneNumber}}</p>
            </el-col>
            <el-col :span="9">
              <p>邮箱:{{user.email}}</p>
            </el-col>
            <el-col :span="9">
              <p>性别:{{user.gender}}</p>
            </el-col>
          </el-row>

          <el-row :gutter="30">

            <el-col style="text-align: center;" :span="8">
              <div>
                <h1>发布类别</h1>
                <div id="main" style="width: 600px;height:400px;"></div>
              </div>
            </el-col>
            <el-col style="text-align: center;" :span="8">
              <div>
                <h1>交易评价</h1>
                <div id="main1" style="width: 600px;height:400px;"></div>

              </div>
            </el-col>

            <el-col style="text-align: center;" :span="8">
              <div>
                <h1>交易量</h1>
                <div id="main2" style="width: 600px;height:400px;"></div>

              </div>
            </el-col>
          </el-row>

        </el-main>

        <!-- 个人信息-我的发布 -->
        <el-main v-show="show_content.i2">
          <el-row>
            <el-input clearable style="width: 30%;" placeholder="请输入内容" v-model="searchGoods_me"
              class="input-with-select">
              <el-select v-model="select_mode" slot="prepend" placeholder="请选择">
                <el-option label="商品ID" value="1"></el-option>
                <el-option label="商品名称" value="2"></el-option>
              </el-select>
              <el-button slot="append" icon="el-icon-search" @click="selectGoods(1)"></el-button>
            </el-input>
            <el-button type="primary" @click="openForm_newgoods">发布商品</el-button>
          </el-row>



          <template>
            <el-table :data="goods" style="width: 100%">
              <el-table-column type="expand">
                <template slot-scope="props">
                  <el-form label-position="left" inline class="demo-table-expand">
                    <el-form-item label="商品图片">
                      <img :src="props.row.goodsImg" style="
                                  width: 150px;
                                  height: 100px;
                                  ">
                    </el-form-item>
                    <el-form-item label="商品 ID">
                      <span>{{ props.row.goodsId }}</span>
                    </el-form-item>
                    <el-form-item label="商品名称">
                      <span>{{ props.row.goodsName }}</span>
                    </el-form-item>

                    <el-form-item label="商品分类">
                      <span>{{ props.row.categoryNameF }}-{{ props.row.categoryNameS }}</span>
                    </el-form-item>
                    <el-form-item label="商品价格">
                      <span>{{ props.row.price }}</span>
                    </el-form-item>
                    <el-form-item label="交易方式">
                      <span>{{ props.row.dealWay }}</span>
                    </el-form-item>
                    <el-form-item label="商品描述">
                      <span>{{ props.row.goodsContent }}</span>
                    </el-form-item>
                  </el-form>
                </template>
              </el-table-column>
              <el-table-column label="商品 ID" prop="goodsId">
              </el-table-column>
              <el-table-column label="商品名称" prop="goodsName">
              </el-table-column>
              <el-table-column label="商品价格" prop="price">
              </el-table-column>


              <el-table-column prop="dealWay" label="交易方式"
                :filters="[{ text: '金钱交易', value: '金钱交易' }, { text: '以物易物', value: '以物易物' }]"
                :filter-method="filterDealWayTag" filter-placement="bottom-end">
                <template slot-scope="scope">
                  <el-tag :type="scope.row.dealWay === '金钱交易' ? 'primary' : 'success'"
                    disable-transitions>{{scope.row.dealWay}}</el-tag>
                </template>
              </el-table-column>

              <el-table-column prop="categoryNameF" label="商品类别" :filters="[{ text: '服装', value: '服装' }, { text: '数码', value: '数码' }
                      , { text: '电器', value: '电器' }, { text: '医药', value: '医药' }
                      , { text: '食品', value: '食品' }, { text: '书籍', value: '书籍' }]" :filter-method="filterTag"
                filter-placement="bottom-end">
                <template slot-scope="scope">
                  <el-tag :type="tagSelect(scope.row.categoryNameF)"
                    disable-transitions>{{scope.row.categoryNameF}}</el-tag>

                </template>
              </el-table-column>

              <el-table-column label="操作">
                <template slot-scope="scope">
                  <el-button size="mini" type="danger" :disabled="scope.row.status=='已卖出'||scope.row.status=='待交易'"
                    v-on:click="removeGoods(scope.row.goodsId)">下架</el-button>
                </template>
              </el-table-column>
            </el-table>
          </template>
        </el-main>

        <!-- 个人信息-我的审核 -->
        <el-main v-show="show_content.i3">
          <el-row style="width: 30%;">
            <el-input placeholder="请输入商品id" v-model="goodsId_mychecking" clearable>
              <el-button slot="append" icon="el-icon-search" @click="selectCheckingGoods(1)"></el-button>
            </el-input>
          </el-row>



          <template>
            <el-table :data="goods_checking" style="width: 100%">
              <el-table-column type="expand">
                <template slot-scope="props">
                  <el-form label-position="left" inline class="demo-table-expand">
                    <el-form-item label="商品图片">
                      <img :src="props.row.goodsImg" style="
                              width: 150px;
                              height: 100px;
                              ">
                    </el-form-item>
                    <el-form-item label="商品 ID">
                      <span>{{ props.row.goodsId }}</span>
                    </el-form-item>
                    <el-form-item label="商品名称">
                      <span>{{ props.row.goodsName }}</span>
                    </el-form-item>

                    <el-form-item label="商品分类">
                      <span>{{ props.row.categoryNameF }}-{{ props.row.categoryNameS }}</span>
                    </el-form-item>
                    <el-form-item label="商品价格">
                      <span>{{ props.row.price }}</span>
                    </el-form-item>
                    <el-form-item label="交易方式">
                      <span>{{ props.row.dealWay }}</span>
                    </el-form-item>
                    <el-form-item label="商品描述">
                      <span>{{ props.row.goodsContent }}</span>
                    </el-form-item>
                  </el-form>
                </template>
              </el-table-column>
              <el-table-column label="商品 ID" prop="goodsId">
              </el-table-column>
              <el-table-column label="商品名称" prop="goodsName">
              </el-table-column>
              <el-table-column label="商品价格" prop="price">
              </el-table-column>


              <el-table-column prop="dealWay" label="交易方式"
                :filters="[{ text: '金钱交易', value: '金钱交易' }, { text: '以物易物', value: '以物易物' }]"
                :filter-method="filterDealWayTag" filter-placement="bottom-end">
                <template slot-scope="scope">
                  <el-tag :type="scope.row.dealWay === '金钱交易' ? 'primary' : 'success'"
                    disable-transitions>{{scope.row.dealWay}}</el-tag>
                </template>
              </el-table-column>

              <el-table-column prop="categoryNameF" label="商品类别" :filters="[{ text: '服装', value: '服装' }, { text: '数码', value: '数码' }
                  , { text: '电器', value: '电器' }, { text: '医药', value: '医药' }
                  , { text: '食品', value: '食品' }, { text: '书籍', value: '书籍' }]" :filter-method="filterTag"
                filter-placement="bottom-end">
                <template slot-scope="scope">
                  <el-tag :type="tagSelect(scope.row.categoryNameF)"
                    disable-transitions>{{scope.row.categoryNameF}}</el-tag>

                </template>
              </el-table-column>

              <el-table-column label="状态" prop="status">
              </el-table-column>


            </el-table>
          </template>
        </el-main>

        <!-- 个人信息-我的订单 -->
        <el-main v-show="show_content.i4">
          <el-row style="width: 30%;">
            <el-input placeholder="请输入订单id" v-model="orderId_mybuy" clearable>
              <el-button slot="append" icon="el-icon-search" @click="searchOrder(1)"></el-button>
            </el-input>

          </el-row>



          <template>
            <el-table :data="myorders" style="width: 100%">
              <el-table-column type="expand">
                <template slot-scope="props">
                  <el-form label-position="left" inline class="demo-table-expand">
                    <el-form-item label="商品图片">
                      <img :src="props.row.goodsImg" style="
                            width: 150px;
                            height: 100px;
                            ">
                    </el-form-item>
                    <el-form-item label="订单 ID">
                      <span>{{ props.row.orderId }}</span>
                    </el-form-item>
                    <el-form-item label="订单时间">
                      <span>{{ props.row.datetime }}</span>
                    </el-form-item>
                    <el-form-item label="商品 ID">
                      <span>{{ props.row.goodsId }}</span>
                    </el-form-item>
                    <el-form-item label="商品名称">
                      <span>{{ props.row.goodsName }}</span>
                    </el-form-item>
                    <el-form-item label="卖家昵称">
                      <span>{{ props.row.sellerName }}</span>
                    </el-form-item>

                    <el-form-item label="商品分类">
                      <span>{{ props.row.categoryNameF }}-{{ props.row.categoryNameS }}</span>
                    </el-form-item>
                    <el-form-item label="商品价格">
                      <span>{{ props.row.price }}</span>
                    </el-form-item>
                    <el-form-item label="交易方式">
                      <span>{{ props.row.dealWay }}</span>
                    </el-form-item>
                    <el-form-item label="交易评价">
                      <span v-show="props.row.appraise!=0">
                        <span v-for="i in props.row.appraise">⭐</span>

                      </span>
                    </el-form-item>
                    <el-form-item label="联系商家">
                      <a style="color: #008c8c;" v-on:click="goChat(props.row.sellerId)">点我</span>
                    </el-form-item>
                  </el-form>
                </template>
              </el-table-column>
              <el-table-column label="订单 ID" prop="orderId">
              </el-table-column>
              <el-table-column label="商品名称" prop="goodsName">
              </el-table-column>
              <el-table-column label="商品价格" prop="price">
              </el-table-column>


              <el-table-column prop="dealWay" label="交易方式"
                :filters="[{ text: '金钱交易', value: '金钱交易' }, { text: '以物易物', value: '以物易物' }]"
                :filter-method="filterDealWayTag" filter-placement="bottom-end">
                <template slot-scope="scope">
                  <el-tag :type="scope.row.dealWay === '金钱交易' ? 'primary' : 'success'"
                    disable-transitions>{{scope.row.dealWay}}</el-tag>
                </template>
              </el-table-column>

              <el-table-column prop="categoryNameF" label="商品类别" :filters="[{ text: '服装', value: '服装' }, { text: '数码', value: '数码' }
                , { text: '电器', value: '电器' }, { text: '医药', value: '医药' }
                , { text: '食品', value: '食品' }, { text: '书籍', value: '书籍' }]" :filter-method="filterTag"
                filter-placement="bottom-end">
                <template slot-scope="scope">
                  <el-tag :type="tagSelect(scope.row.categoryNameF)"
                    disable-transitions>{{scope.row.categoryNameF}}</el-tag>

                </template>
              </el-table-column>

              <el-table-column label="状态" prop="status">
              </el-table-column>

              <el-table-column label="操作">
                <template slot-scope="scope">
                  <el-button size="big" type="primary" :disabled="scope.row.status=='已完成'"
                    v-on:click="CompletedDeal(scope.row.orderId)">完成交易</el-button>


                  <el-button size="big" type="danger" :disabled="scope.row.status!='已提交'"
                    v-on:click="cancelOrder(scope.row.orderId)">取消订单</el-button>
                </template>

              </el-table-column>

            </el-table>
          </template>
        </el-main>


        <!-- 个人信息-我的卖出订单 -->
        <el-main v-show="show_content.i9">
          <el-row style="width: 30%;">
            <el-input placeholder="请输入订单id" v-model="orderId_mysell" clearable>
              <el-button slot="append" icon="el-icon-search" @click="searchOrder(2)"></el-button>
            </el-input>

          </el-row>



          <template>
            <el-table :data="mysellorders" style="width: 100%">
              <el-table-column type="expand">
                <template slot-scope="props">
                  <el-form label-position="left" inline class="demo-table-expand">
                    <el-form-item label="商品图片">
                      <img :src="props.row.goodsImg" style="
                            width: 150px;
                            height: 100px;
                            ">
                    </el-form-item>
                    <el-form-item label="订单 ID">
                      <span>{{ props.row.orderId }}</span>
                    </el-form-item>
                    <el-form-item label="订单时间">
                      <span>{{ props.row.datetime }}</span>
                    </el-form-item>
                    <el-form-item label="商品 ID">
                      <span>{{ props.row.goodsId }}</span>
                    </el-form-item>
                    <el-form-item label="商品名称">
                      <span>{{ props.row.goodsName }}</span>
                    </el-form-item>
                    <el-form-item label="卖家昵称">
                      <span>{{ props.row.sellerName }}</span>
                    </el-form-item>

                    <el-form-item label="商品分类">
                      <span>{{ props.row.categoryNameF }}-{{ props.row.categoryNameS }}</span>
                    </el-form-item>
                    <el-form-item label="商品价格">
                      <span>{{ props.row.price }}</span>
                    </el-form-item>
                    <el-form-item label="交易方式">
                      <span>{{ props.row.dealWay }}</span>
                    </el-form-item>
                    <el-form-item label="交易评价">
                      <span v-show="props.row.appraise!=0">
                        <span v-for="i in props.row.appraise">⭐</span>

                      </span>
                    </el-form-item>
                  </el-form>
                </template>
              </el-table-column>
              <el-table-column label="订单 ID" prop="orderId">
              </el-table-column>
              <el-table-column label="商品名称" prop="goodsName">
              </el-table-column>
              <el-table-column label="商品价格" prop="price">
              </el-table-column>


              <el-table-column prop="dealWay" label="交易方式"
                :filters="[{ text: '金钱交易', value: '金钱交易' }, { text: '以物易物', value: '以物易物' }]"
                :filter-method="filterDealWayTag" filter-placement="bottom-end">
                <template slot-scope="scope">
                  <el-tag :type="scope.row.dealWay === '金钱交易' ? 'primary' : 'success'"
                    disable-transitions>{{scope.row.dealWay}}</el-tag>
                </template>
              </el-table-column>

              <el-table-column prop="categoryNameF" label="商品类别" :filters="[{ text: '服装', value: '服装' }, { text: '数码', value: '数码' }
                , { text: '电器', value: '电器' }, { text: '医药', value: '医药' }
                , { text: '食品', value: '食品' }, { text: '书籍', value: '书籍' }]" :filter-method="filterTag"
                filter-placement="bottom-end">
                <template slot-scope="scope">
                  <el-tag :type="tagSelect(scope.row.categoryNameF)"
                    disable-transitions>{{scope.row.categoryNameF}}</el-tag>

                </template>
              </el-table-column>

              <el-table-column label="状态" prop="status">
              </el-table-column>

              <el-table-column label="操作">
                <template slot-scope="scope">
                  <el-button size="big" type="danger" :disabled="scope.row.status!='已提交'"
                    v-on:click="cancelOrder(scope.row.orderId)">取消订单</el-button>
                </template>
              </el-table-column>

            </el-table>
          </template>
        </el-main>



        <!-- 商品页面 -->
        <el-main v-show="show_content.i5">
          <el-row>
            <el-input clearable style="width: 30%;" placeholder="请输入内容" v-model="searchGoods_me"
              class="input-with-select">
              <el-select v-model="select_mode" slot="prepend" placeholder="请选择">
                <el-option label="商品ID" value="1"></el-option>
                <el-option label="商品名称" value="2"></el-option>
              </el-select>
              <el-button slot="append" icon="el-icon-search" @click="selectGoods(2)"></el-button>
            </el-input>
            <el-button type="primary" @click="openForm_newgoods">发布商品</el-button>
          </el-row>

          <template>
            <el-table :data="allgoods" style="width: 100%;">
              <el-table-column type="expand">
                <template slot-scope="props">
                  <el-form label-position="left" inline class="demo-table-expand">
                    <el-form-item label="商品图片">
                      <img :src="props.row.goodsImg" style="
                                width: 150px;
                                height: 100px;
                                ">
                    </el-form-item>
                    <el-form-item label="商品 ID">
                      <span>{{ props.row.goodsId }}</span>
                    </el-form-item>
                    <el-form-item label="商品名称">
                      <span>{{ props.row.goodsName }}</span>
                    </el-form-item>

                    <el-form-item label="商品分类">
                      <span>{{ props.row.categoryNameF }}-{{ props.row.categoryNameS }}</span>
                    </el-form-item>
                    <el-form-item label="商品价格">
                      <span>{{ props.row.price }}</span>
                    </el-form-item>
                    <el-form-item label="交易方式">
                      <span>{{ props.row.dealWay }}</span>
                    </el-form-item>
                    <el-form-item label="商品描述">
                      <span>{{ props.row.goodsContent }}</span>
                    </el-form-item>
                    <el-form-item label="联系商家">
                      <a style="color: #008c8c;" v-on:click="goChat(props.row.userId)">点我</span>
                    </el-form-item>
                  </el-form>
                </template>
              </el-table-column>

              <el-table-column label="商品名称" prop="goodsName">
              </el-table-column>

              <el-table-column label="商品图片" prop="goodsImg">
                <template slot-scope="scope">
                  <img :src="scope.row.goodsImg" style="height: 100px; width: 150px;" />
                </template>
              </el-table-column>

              <el-table-column label="商品价格" prop="price">
              </el-table-column>


              <el-table-column prop="dealWay" label="交易方式"
                :filters="[{ text: '金钱交易', value: '金钱交易' }, { text: '以物易物', value: '以物易物' }]"
                :filter-method="filterDealWayTag" filter-placement="bottom-end">
                <template slot-scope="scope">
                  <el-tag :type="scope.row.dealWay === '金钱交易' ? 'primary' : 'success'"
                    disable-transitions>{{scope.row.dealWay}}</el-tag>
                </template>
              </el-table-column>

              <el-table-column prop="categoryNameF" label="商品类别" :filters="[{ text: '服装', value: '服装' }, { text: '数码', value: '数码' }
                    , { text: '电器', value: '电器' }, { text: '医药', value: '医药' }
                    , { text: '食品', value: '食品' }, { text: '书籍', value: '书籍' }]" :filter-method="filterTag"
                filter-placement="bottom-end">
                <template slot-scope="scope">
                  <el-tag :type="tagSelect(scope.row.categoryNameF)"
                    disable-transitions>{{scope.row.categoryNameF}}</el-tag>

                </template>
              </el-table-column>

              <el-table-column label="操作">
                <template slot-scope="scope">
                  <el-button size="big" type="primary" v-on:click="buyGoods(scope.row.goodsId)">购买</el-button>
                </template>
              </el-table-column>
            </el-table>
          </template>
        </el-main>





        <!-- 管理页面 -->
        <!-- 管理页面-商品审核 -->
        <el-main v-show="show_content.i6">
          <el-row style="width: 30%;">
            <el-input placeholder="请输入商品id" v-model="goodsId_checking" clearable>
              <el-button slot="append" icon="el-icon-search" @click="selectCheckingGoods(2)"></el-button>
            </el-input>
          </el-row>



          <template>
            <el-table :data="goods_checking_all" style="width: 100%">
              <el-table-column type="expand">
                <template slot-scope="props">
                  <el-form label-position="left" inline class="demo-table-expand">
                    <el-form-item label="商品图片">
                      <img :src="props.row.goodsImg" style="
                            width: 150px;
                            height: 100px;
                            ">
                    </el-form-item>
                    <el-form-item label="商品 ID">
                      <span>{{ props.row.goodsId }}</span>
                    </el-form-item>
                    <el-form-item label="商品名称">
                      <span>{{ props.row.goodsName }}</span>
                    </el-form-item>

                    <el-form-item label="商品分类">
                      <span>{{ props.row.categoryNameF }}-{{ props.row.categoryNameS }}</span>
                    </el-form-item>
                    <el-form-item label="商品价格">
                      <span>{{ props.row.price }}</span>
                    </el-form-item>
                    <el-form-item label="交易方式">
                      <span>{{ props.row.dealWay }}</span>
                    </el-form-item>
                    <el-form-item label="商品描述">
                      <span>{{ props.row.goodsContent }}</span>
                    </el-form-item>
                  </el-form>
                </template>
              </el-table-column>
              <el-table-column label="商品 ID" prop="goodsId">
              </el-table-column>
              <el-table-column label="商品名称" prop="goodsName">
              </el-table-column>
              <el-table-column label="商品价格" prop="price">
              </el-table-column>


              <el-table-column prop="dealWay" label="交易方式"
                :filters="[{ text: '金钱交易', value: '金钱交易' }, { text: '以物易物', value: '以物易物' }]"
                :filter-method="filterDealWayTag" filter-placement="bottom-end">
                <template slot-scope="scope">
                  <el-tag :type="scope.row.dealWay === '金钱交易' ? 'primary' : 'success'"
                    disable-transitions>{{scope.row.dealWay}}</el-tag>
                </template>
              </el-table-column>

              <el-table-column prop="categoryNameF" label="商品类别" :filters="[{ text: '服装', value: '服装' }, { text: '数码', value: '数码' }
                , { text: '电器', value: '电器' }, { text: '医药', value: '医药' }
                , { text: '食品', value: '食品' }, { text: '书籍', value: '书籍' }]" :filter-method="filterTag"
                filter-placement="bottom-end">
                <template slot-scope="scope">
                  <el-tag :type="tagSelect(scope.row.categoryNameF)"
                    disable-transitions>{{scope.row.categoryNameF}}</el-tag>

                </template>
              </el-table-column>

              <el-table-column label="状态" prop="status">
              </el-table-column>


              <el-table-column label="操作">
                <template slot-scope="scope">
                  <el-button size="big" type="primary" v-on:click="acceptGoods(scope.row.goodsId)">通过</el-button>
                  <el-button size="big" type="danger" v-on:click="refuseGoods(scope.row.goodsId)">拒绝</el-button>
                </template>
              </el-table-column>


            </el-table>
          </template>
        </el-main>





        <!-- 管理页面 用户管理--->
        <el-main v-show="show_content.i7">
          <el-row>
            <el-input clearable style="width: 30%;" placeholder="请输入内容" v-model="searchUser" class="input-with-select">
              <el-select v-model="select_mode_user" slot="prepend" placeholder="请选择">
                <el-option label="用户ID" value="1"></el-option>
                <el-option label="手机号码" value="2"></el-option>
              </el-select>
              <el-button slot="append" icon="el-icon-search" @click="selectUser"></el-button>
            </el-input>
            <el-button type="primary" @click="openForm_newuser">添加用户</el-button>
            <el-button type="warning" @click="openForm_level">修改权限</el-button>
          </el-row>

          <template>
            <el-table :data="users" style="width: 100%;">

              <el-table-column label="用户id" prop="userId">
              </el-table-column>

              <el-table-column label="名称" prop="username">
              </el-table-column>

              <el-table-column label="手机号" prop="phoneNumber">
              </el-table-column>

              <el-table-column label="邮箱" prop="email">

              </el-table-column>
              <el-table-column prop="gender" label="性别"
                :filters="[{ text: '男', value: '男' }, { text: '女', value: '女' }]" :filter-method="filterGenderTag"
                filter-placement="bottom-end">
                <template slot-scope="scope">
                  <el-tag :type="scope.row.gender === '男' ? 'primary' : 'danger'"
                    disable-transitions>{{scope.row.gender}}</el-tag>
                </template>
              </el-table-column>

              <el-table-column prop="level" label="权限等级" :filters="[{ text: '超级管理员权限', value: '3' }, { text: '管理员权限', value: '2' }
                        , { text: '普通用户权限', value: '1' }]" :filter-method="filterLevelTag"
                filter-placement="bottom-end">
                <template slot-scope="scope">
                  <el-tag :type="tagSelect(scope.row.level)" disable-transitions>权限等级-{{scope.row.level}}</el-tag>

                </template>
              </el-table-column>

              <el-table-column label="操作">
                <template slot-scope="scope">
                  <el-button size="big" type="primary" v-on:click="updateUser(scope.row)">修改</el-button>
                  <el-button size="big" type="danger" v-on:click="removeUser(scope.row.userId)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
          </template>
        </el-main>



        <!-- 管理页面-商品管理 -->
        <el-main v-show="show_content.i8">
          <el-row>
            <el-input clearable style="width: 30%;" placeholder="请输入内容" v-model="searchGoods_me"
              class="input-with-select">
              <el-select v-model="select_mode" slot="prepend" placeholder="请选择">
                <el-option label="商品ID" value="1"></el-option>
                <el-option label="商品名称" value="2"></el-option>
              </el-select>
              <el-button slot="append" icon="el-icon-search" @click="selectGoods(3)"></el-button>
            </el-input>
          </el-row>



          <template>
            <el-table :data="allgoods_level" style="width: 100%">
              <el-table-column type="expand">
                <template slot-scope="props">
                  <el-form label-position="left" inline class="demo-table-expand">
                    <el-form-item label="商品图片">
                      <img :src="props.row.goodsImg" style="
                            width: 150px;
                            height: 100px;
                            ">
                    </el-form-item>
                    <el-form-item label="商品 ID">
                      <span>{{ props.row.goodsId }}</span>
                    </el-form-item>
                    <el-form-item label="商品名称">
                      <span>{{ props.row.goodsName }}</span>
                    </el-form-item>

                    <el-form-item label="商品分类">
                      <span>{{ props.row.categoryNameF }}-{{ props.row.categoryNameS }}</span>
                    </el-form-item>
                    <el-form-item label="商品价格">
                      <span>{{ props.row.price }}</span>
                    </el-form-item>
                    <el-form-item label="交易方式">
                      <span>{{ props.row.dealWay }}</span>
                    </el-form-item>
                    <el-form-item label="商品描述">
                      <span>{{ props.row.goodsContent }}</span>
                    </el-form-item>
                  </el-form>
                </template>
              </el-table-column>
              <el-table-column label="商品 ID" prop="goodsId">
              </el-table-column>
              <el-table-column label="商品名称" prop="goodsName">
              </el-table-column>
              <el-table-column label="商品价格" prop="price">
              </el-table-column>


              <el-table-column prop="dealWay" label="交易方式"
                :filters="[{ text: '金钱交易', value: '金钱交易' }, { text: '以物易物', value: '以物易物' }]"
                :filter-method="filterDealWayTag" filter-placement="bottom-end">
                <template slot-scope="scope">
                  <el-tag :type="scope.row.dealWay === '金钱交易' ? 'primary' : 'success'"
                    disable-transitions>{{scope.row.dealWay}}</el-tag>
                </template>
              </el-table-column>

              <el-table-column prop="categoryNameF" label="商品类别" :filters="[{ text: '服装', value: '服装' }, { text: '数码', value: '数码' }
                , { text: '电器', value: '电器' }, { text: '医药', value: '医药' }
                , { text: '食品', value: '食品' }, { text: '书籍', value: '书籍' }]" :filter-method="filterTag"
                filter-placement="bottom-end">
                <template slot-scope="scope">
                  <el-tag :type="tagSelect(scope.row.categoryNameF)"
                    disable-transitions>{{scope.row.categoryNameF}}</el-tag>

                </template>
              </el-table-column>

              <el-table-column label="操作">
                <template slot-scope="scope">
                  <el-button size="mini" type="danger" :disabled="scope.row.status=='已卖出'"
                    v-on:click="removeGoods(scope.row.goodsId)">下架</el-button>
                </template>
              </el-table-column>
            </el-table>
          </template>
        </el-main>



        <!-- 管理页面 订单管理--->
        <el-main v-show="show_content.i10">
          <el-row style="width: 30%;">
            <el-input placeholder="请输入订单id" v-model="orderId_mysell" clearable>
              <el-button slot="append" icon="el-icon-search" @click="searchOrder(3)"></el-button>
            </el-input>

          </el-row>

          <template>
            <el-table :data="orders" style="width: 100%;">
              <el-table-column label="订单号" prop="orderId">
              </el-table-column>
              <el-table-column label="商品号" prop="goodsId">
              </el-table-column>

              <el-table-column label="卖家Id" prop="sellerId">
              </el-table-column>

              <el-table-column label="买家Id" prop="buyId">
              </el-table-column>

              <el-table-column label="商品价格" prop="price">
              </el-table-column>

              <el-table-column label="订单状态" prop="status">
              </el-table-column>
              <el-table-column label="评价" prop="appraise">
              </el-table-column>
              <el-table-column label="操作">
                <template slot-scope="scope">
                  <el-button size="big" type="warning" v-on:click="resetAppraise(scope.row.orderId)">重置评价</el-button>
                </template>
              </el-table-column>
            </el-table>
          </template>
        </el-main>


      </el-container>
    </el-container>










    <!--弹窗信息_添加商品-->
    <el-dialog title="添加商品" :visible.sync="dialogVisible_newgoods" width="35%">
      <el-form ref="form" :model="userNewgoodsForm" label-width="80px" :rules="rules" ref="ruleForm">
        <el-form-item label="商品名称" prop="name">
          <el-input show-word-limit type="text" maxlength="15" v-model="userNewgoodsForm.goodsName"></el-input>
        </el-form-item>

        <el-form-item label="商品价格" prop="price">
          <el-input v-model="userNewgoodsForm.price"></el-input>
        </el-form-item>
        <el-form-item label="商品描述" prop="content">
          <el-input type="text" show-word-limit maxlength="40" v-model="userNewgoodsForm.goodsContent"></el-input>
        </el-form-item>

        <el-form-item label="商品类型" prop="type">
          <el-cascader :options="options" change-on-select v-model="selectedOptions3"></el-cascader>

        </el-form-item>
        <el-form-item label="交易方式" prop="type">
          <el-select v-model="userNewgoodsForm.dealWay" placeholder="请选择交易方式">
            <el-option label="金钱交易 " value="M"></el-option>
            <el-option label="以物易物" value="G"></el-option>
          </el-select>
        </el-form-item>



        <el-form-item label="商品照片">
          <el-upload class="upload-demo" drag action="http://localhost:8088/uploadImg" header="{{authorization}}"
            name="file" :on-success="uploadGoodsImg" limit=1 :on-exceed="limit" multiple>
            <i class="el-icon-upload"></i>
            <div class="el-upload__text">将文件拖到此处，或点击上传</div>
            <div class="el-upload__tip" slot="tip">只能上传jpg/png文件，且不超过5MB</div>
          </el-upload>
        </el-form-item>

        <el-form-item>
          <el-button type="primary" @click="addGoods">立即添加</el-button>
          <el-button type="info" @click="addRest">重置</el-button>
          <el-button @click="onClose_newgoods">取消</el-button>
        </el-form-item>

      </el-form>
    </el-dialog>

    <!--弹窗信息_添加用户-->
    <el-dialog title="新增用户" :visible.sync="dialogVisible_newuser" width="35%">
      <el-form ref="form" :model="newUserForm" label-width="80px" :rules="rules" ref="ruleForm">
        <el-form-item label="用户名称" prop="username">
          <el-input show-word-limit type="text" maxlength="15" v-model="newUserForm.username"></el-input>
        </el-form-item>

        <el-form-item label="手机号码" prop="phoneNumber">
          <el-input v-model="newUserForm.phoneNumber"></el-input>
        </el-form-item>
        <el-form-item label="邮箱" prop="email">
          <el-input v-model="newUserForm.email"></el-input>
        </el-form-item>
        <el-form-item label="密码" prop="password">
          <el-input v-model="newUserForm.password"></el-input>
        </el-form-item>



        </el-form-item>
        <el-form-item label="性别" prop="gender">
          <el-select v-model="newUserForm.gender" placeholder="请选择用户性别">
            <el-option label="男 " value="男"></el-option>
            <el-option label="女" value="女"></el-option>
          </el-select>
        </el-form-item>



        <el-form-item label="用户头像">
          <el-upload class="upload-demo" drag action="http://localhost:8088/uploadImg" header="{{authorization}}"
            name="file" :on-success="uploadHeadImg" limit=1 :on-exceed="limit" multiple>
            <i class="el-icon-upload"></i>
            <div class="el-upload__text">将文件拖到此处，或点击上传</div>
            <div class="el-upload__tip" slot="tip">只能上传jpg/png文件，且不超过5MB</div>
          </el-upload>
        </el-form-item>

        <el-form-item>
          <el-button type="primary" @click="addUser">立即添加</el-button>
          <el-button type="info" @click="addUserRest">重置</el-button>
          <el-button @click="onClose_newuser">取消</el-button>
        </el-form-item>

      </el-form>
    </el-dialog>


    <!--弹窗信息_修改用户密码-->
    <el-dialog title="修改密码" :visible.sync="dialogVisible_password" width="35%">
      <el-form ref="form" :model="userPasswordForm" label-width="80px">
        <el-form-item label="原始密码" prop="password">
          <el-input v-model="userPasswordForm.password"></el-input>
        </el-form-item>

        <el-form-item label="新密码" prop="newpassword">
          <el-input v-model="userPasswordForm.newpassword"></el-input>
        </el-form-item>



        <el-form-item>
          <el-button type="primary" @click="onUpdate_password">立即修改</el-button>
          <el-button @click="onClose_password">取消</el-button>
        </el-form-item>

      </el-form>
    </el-dialog>


    <!--弹窗信息_获取日志-->
    <el-dialog title="获取日志" :visible.sync="dialogVisible_log" width="35%">
      <el-form ref="form" :model="logForm" label-width="80px">
        <el-form-item label="日志等级" prop="level">
          <el-select v-model="logForm.level" placeholder="请选择用户权限">
            <el-option label="error" value="error"></el-option>
            <el-option label="info" value="info"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="日志日期" prop="date">


          <el-date-picker v-model="logForm.date" align="right" type="date" placeholder="选择日期"
            :picker-options="pickerOptions1">
          </el-date-picker>

        </el-form-item>



        <el-form-item>
          <el-button type="primary" @click="get_log">获取</el-button>
          <el-button @click="onClose_log">取消</el-button>
        </el-form-item>

      </el-form>
    </el-dialog>

    <!--弹窗信息_评价交易-->
    <el-dialog title="请对此次交易做出评价" :visible.sync="dialogVisible_appraise" width="18%">
      <el-form ref="form" label-width="80px">
        <el-form-item>

          <el-rate v-model="appraise" show-text>
          </el-rate>

        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="sumbit_appraise">提交评价</el-button>
        </el-form-item>

      </el-form>
    </el-dialog>



    <!--弹窗信息_修改用户权限-->
    <el-dialog title="修改权限" :visible.sync="openForm_newuserlevel" width="35%">
      <el-form ref="form" :model="userLevelForm" label-width="80px">
        <el-form-item label="用户ID" prop="userId">
          <el-input v-model="userLevelForm.userId"></el-input>
        </el-form-item>

        <el-form-item label="权限等级" prop="level">
          <el-select v-model="userLevelForm.level" placeholder="请选择用户权限">
            <el-option label="普通用户" value=1></el-option>
            <el-option label="管理员用户" value="2"></el-option>
          </el-select>
        </el-form-item>



        <el-form-item>
          <el-button type="primary" @click="onUpdate_level">立即修改</el-button>
          <el-button @click="onClose_level">取消</el-button>
        </el-form-item>

      </el-form>
    </el-dialog>


    <!--弹窗信息_修改用户信息-->
    <el-dialog title="修改用户信息" :visible.sync="openForm_userinformation" width="35%">
      <el-form ref="form" :model="updateUserForm" label-width="80px">
        <el-form-item label="用户名称" prop="username">
          <el-input v-model="updateUserForm.username"></el-input>
        </el-form-item>

        <el-form-item label="邮箱" prop="email">
          <el-input v-model="updateUserForm.email"></el-input>
        </el-form-item>

        <el-form-item label="电话" prop="phoneNumber">
          <el-input v-model="updateUserForm.phoneNumber"></el-input>
        </el-form-item>


        <el-form-item label="性别" prop="gender">
          <el-select v-model="updateUserForm.gender" placeholder="请选择用户性别">
            <el-option label="男" value="男"></el-option>
            <el-option label="女" value="女"></el-option>
          </el-select>
        </el-form-item>



        <el-form-item>
          <el-button type="primary" @click="onUpdate_information">立即修改</el-button>
          <el-button @click="onClose_userInformation">取消</el-button>
        </el-form-item>

      </el-form>
    </el-dialog>


  </div>
  <script src="https://cdn.goeasy.io/goeasy-2.6.6.min.js"></script>
  <script src="../js/echarts.js"></script>
  <script src="../js/axios-0.18.0.js"></script>
  <script src="../js/vue.js"></script>
  <script src="../plugins/elementui/index.js"></script>
  <script src="../js/platform.js"></script>

</body>

</html>